package com.hsgene.order.constants;

/**
 * 机构还是运营后台
 *
 * @author fuxiang
 * @version 1.0, 2018/8/3
 */
public enum SuppliOrConsoleType {

    CONSOLE("console", "运营后台"),
    SUPPLIE("supplie", "机构"),

    UNDEFINED("undeifine", "未知");
    /**
     * 编码
     */
    private final String code;

    /**
     * 描述
     */
    private final String desc;

    public static SuppliOrConsoleType getEnum(String code) {
        for (SuppliOrConsoleType type : values()) {
            if (type.code.equalsIgnoreCase(code)) {
                return type;
            }
        }
        return UNDEFINED;
    }

    SuppliOrConsoleType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
